package com.peace.hospital.opdept.mapper.outpatientdept;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.peace.hospital.entity.outpatientdept.Inpatientmessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 住院病人信息表 Mapper 接口
 * </p>
 *
 * @author 谢晓峰
 * @since 2019-11-11
 */
@Mapper
public interface InpatientmessageMapper extends BaseMapper<Inpatientmessage> {

    @Select("select * from inpatientmessage where pid=#{pid}")
    List<Inpatientmessage> selectInpatientmessagesByPid(Integer pid);

    @Select("select timestampdiff(day,#{inpadmdate},#{inpdischargedate}) ")
    Integer selectDateDifference(Inpatientmessage inpatientmessage);
}
